﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:System="clr-namespace:System;assembly=mscorlib"
             xmlns:ec="http://schemas.microsoft.com/expression/2010/controls"
             xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
             xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             x:Class="MainGameModule.Views.GameEventsView"
             xmlns:converters="clr-namespace:MainGameModule.Views.Converters"
             Height="480"
             Width="700"
             mc:Ignorable="d">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/YourWorld.Common;component/Styles/CommonResourcesDictionary.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />

            <DataTemplate x:Key="EventsDataTemplate">
                <Grid>
                    <Image Margin="5"
                           Source="{Binding Image}"
                           Width="50"
                           Height="50" />
                </Grid>
            </DataTemplate>

            <DataTemplate x:Key="BadgesDataTemplate">
                <StackPanel Orientation="Horizontal">
                    <Grid>
                        <Image Width="50"
                               Margin="5"
                               Source="{Binding Image}" ToolTipService.ToolTip="{Binding Title}" />
                        <StackPanel Orientation="Horizontal"
                                    HorizontalAlignment="Right"
                                    VerticalAlignment="Bottom"
                                    Visibility="{Binding IsLocked, Converter={StaticResource BoolToVisibilityConverter}}">
                            <Image Source="images/hmenu-lock.png" />
                        </StackPanel>
                    </Grid>
                </StackPanel>
            </DataTemplate>

            <ItemsPanelTemplate x:Key="EventsItemsPanelTemplate">
                <StackPanel Orientation="Horizontal" />
            </ItemsPanelTemplate>

 <Style x:Key="GwLiteButtonStyle"
           TargetType="Button">
        <Setter Property="Background"
                Value="#FF1F3B53" />
        <Setter Property="Foreground"
                Value="#FF000000" />
        <Setter Property="Padding"
                Value="3" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="Margin"
                Value="10" />
        <Setter Property="Foreground"
                Value="White" />
        <Setter Property="FontSize"
                Value="12" />
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1"
                                     StartPoint="0.5,0">
                    <GradientStop Color="#FFA3AEB9"
                                  Offset="0" />
                    <GradientStop Color="#FF8399A9"
                                  Offset="0.375" />
                    <GradientStop Color="#FF718597"
                                  Offset="0.375" />
                    <GradientStop Color="#FF617584"
                                  Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.2" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="BackgroundAnimation" />
                                        <ColorAnimation Duration="0"
                                                        To="#FFB1D35A"
                                                        Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                        Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                        To="#FF6B8422"
                                                        Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                        Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                        To="#FF6B8422"
                                                        Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                        Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                        To="#FF6B8422"
                                                        Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
                                                        Storyboard.TargetName="BackgroundAnimation"
                                                         />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        To="#FF6B8422"
                                                        Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
                                                        Storyboard.TargetName="Background" />
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="BackgroundAnimation" />
                                        <ColorAnimation Duration="0"
                                                        To="#D8FFFFFF"
                                                        Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                                        Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                        To="#C6FFFFFF"
                                                        Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                        Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                        To="#8CFFFFFF"
                                                        Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                        Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                        To="#3FFFFFFF"
                                                        Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                        Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                        To="#FF6B8422"
                                                        Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
                                                        Storyboard.TargetName="BackgroundAnimation"
                                                         />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To=".55"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="DisabledVisualElement" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="FocusVisualElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="#FF7D992F"
                                CornerRadius="3">


                            <Grid
                                  Margin="1">
                                <!--<Rectangle x:Name="BlurredBackground"
                                           Margin="-2"
                                           Fill="#FFC0D864"
                                           RadiusX="5"
                                           RadiusY="5" d:IsHidden="True">
                                    <Rectangle.Effect>
                                        <BlurEffect />
                                    </Rectangle.Effect>
                                </Rectangle>-->
                                <Border x:Name="BackgroundAnimation"
                                        Background="#FF7D992F"
                                        Opacity="0"
                                        CornerRadius="5" />
                                <Rectangle x:Name="BackgroundGradient"
                                           RadiusX="5"
                                           RadiusY="5"
                                           Stroke="#FF5E7716">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint=".7,1"
                                                             StartPoint=".7,0">
                                            <GradientStop Color="#FFC9F65B"
                                                          Offset="0" />
                                            <GradientStop Color="#FFD1E778"
                                                          Offset="0.188" />
                                            <GradientStop Color="#FF678907"
                                                          Offset="1" />
                                            <GradientStop Color="#FFB9D868"
                                                          Offset="0.464" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Grid>
                        </Border>
                        <ContentPresenter x:Name="contentPresenter"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Content="{TemplateBinding Content}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="#FFFFFFFF"
                                   IsHitTestVisible="false"
                                   Opacity="0"
                                   RadiusY="3"
                                   RadiusX="3" />
                        <Rectangle x:Name="FocusVisualElement"
                                   IsHitTestVisible="false"
                                   Margin="1"
                                   Opacity="0"
                                   RadiusY="2"
                                   RadiusX="2"
                                   Stroke="#FF6DBDD1"
                                   StrokeThickness="1" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

            <Style x:Key="EventsListBoxItemStyle"
                   TargetType="ListBoxItem">
                <Setter Property="Padding"
                        Value="3" />
                <Setter Property="HorizontalContentAlignment"
                        Value="Left" />
                <Setter Property="VerticalContentAlignment"
                        Value="Top" />
                <Setter Property="Background"
                        Value="Transparent" />
                <Setter Property="BorderThickness"
                        Value="0" />
                <Setter Property="TabNavigation"
                        Value="Local" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBoxItem">
                            <Grid Background="{TemplateBinding Background}">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal" />
                                        <VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0"
                                                                 To="0.9"
                                                                 Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                 Storyboard.TargetName="contentPresenter"
                                                                 d:IsOptimized="True" />
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Disabled" />
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="SelectionStates">
                                        <VisualState x:Name="Unselected" />
                                        <VisualState x:Name="Selected">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0"
                                                                 To="1"
                                                                 Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                 Storyboard.TargetName="contentPresenter"
                                                                 d:IsOptimized="True" />
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="FocusStates">
                                        <VisualState x:Name="Focused" />
                                        <VisualState x:Name="Unfocused" />
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Rectangle x:Name="fillColor"
                                           IsHitTestVisible="False"
                                           Opacity="0"
                                           RadiusY="1"
                                           RadiusX="1" />
                                <Rectangle x:Name="fillColor2"
                                           Fill="#FFBADDE9"
                                           IsHitTestVisible="False"
                                           Opacity="0"
                                           RadiusY="1"
                                           RadiusX="1" />
                                <ContentPresenter x:Name="contentPresenter"
                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                  Content="{TemplateBinding Content}"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  Margin="{TemplateBinding Padding}"
                                                  Opacity="0.7" />
                                <Rectangle x:Name="FocusVisualElement"
                                           RadiusY="1"
                                           RadiusX="1"
                                           Stroke="#FF6DBDD1"
                                           StrokeThickness="1"
                                           Visibility="Collapsed" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="ScrollBarStyle"
                   TargetType="ScrollBar">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ScrollBar">
                            <Grid x:Name="Root">
                                <Grid.Resources>
                                    <ControlTemplate x:Key="RepeatButtonTemplate"
                                                     TargetType="RepeatButton">
                                        <Grid x:Name="Root"
                                              Background="Transparent">
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal" />
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="HorizontalIncrementTemplate"
                                                     TargetType="RepeatButton">
                                        <Grid x:Name="Root"
                                              Background="#00000000">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="35*" />
                                                <ColumnDefinition Width="30*" />
                                                <ColumnDefinition Width="35*" />
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="25*" />
                                                <RowDefinition Height="50*" />
                                                <RowDefinition Height="25*" />
                                            </Grid.RowDefinitions>
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualStateGroup.Transitions>
                                                        <VisualTransition GeneratedDuration="0:0:0.2"
                                                                          To="MouseOver" />
                                                    </VisualStateGroup.Transitions>
                                                    <VisualState x:Name="Normal" />
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="ButtonVisual"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="#FF557E9A" />
                                                            </ColorAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ButtonVisual"
                                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                                                      Value="0.6" />
                                                            </DoubleAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                                <VisualStateGroup x:Name="FocusStates">
                                                    <VisualState x:Name="Focused">
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                                           Storyboard.TargetName="FocusVisual"
                                                                                           Storyboard.TargetProperty="Visibility">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <Visibility>Visible</Visibility>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Unfocused">
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                                           Storyboard.TargetName="FocusVisual"
                                                                                           Storyboard.TargetProperty="Visibility">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <Visibility>Collapsed</Visibility>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Path x:Name="ButtonVisual"
                                                  Grid.Column="1"
                                                  Grid.Row="1"
                                                  Stretch="Fill"
                                                  Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z ">
                                                <Path.Fill>
                                                    <SolidColorBrush Color="#FF313131"
                                                                     x:Name="ButtonColor" />
                                                </Path.Fill>
                                            </Path>
                                            <Rectangle x:Name="FocusVisual"
                                                       IsHitTestVisible="false"
                                                       Opacity="0"
                                                       Grid.ColumnSpan="3"
                                                       Grid.RowSpan="3"
                                                       Fill="#00000000"
                                                       Stroke="#666666"
                                                       StrokeDashArray=".2 5"
                                                       StrokeDashCap="Round" />
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="HorizontalDecrementTemplate"
                                                     TargetType="RepeatButton">
                                        <Grid x:Name="Root"
                                              Background="#00000000">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="35*" />
                                                <ColumnDefinition Width="30*" />
                                                <ColumnDefinition Width="35*" />
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="25*" />
                                                <RowDefinition Height="50*" />
                                                <RowDefinition Height="25*" />
                                            </Grid.RowDefinitions>
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualStateGroup.Transitions>
                                                        <VisualTransition GeneratedDuration="0:0:0.2"
                                                                          To="MouseOver" />
                                                    </VisualStateGroup.Transitions>
                                                    <VisualState x:Name="Normal" />
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="ButtonVisual"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="#FF557E9A" />
                                                            </ColorAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ButtonVisual"
                                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                                                      Value="0.6" />
                                                            </DoubleAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                                <VisualStateGroup x:Name="FocusStates">
                                                    <VisualState x:Name="Focused">
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                                           Storyboard.TargetName="FocusVisual"
                                                                                           Storyboard.TargetProperty="Visibility">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <Visibility>Visible</Visibility>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Unfocused">
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                                           Storyboard.TargetName="FocusVisual"
                                                                                           Storyboard.TargetProperty="Visibility">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <Visibility>Collapsed</Visibility>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Path x:Name="ButtonVisual"
                                                  Grid.Column="1"
                                                  Grid.Row="1"
                                                  Stretch="Fill"
                                                  Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z ">
                                                <Path.Fill>
                                                    <SolidColorBrush Color="#FF313131"
                                                                     x:Name="ButtonColor" />
                                                </Path.Fill>
                                            </Path>
                                            <Rectangle x:Name="FocusVisual"
                                                       IsHitTestVisible="false"
                                                       Opacity="0"
                                                       Grid.ColumnSpan="3"
                                                       Grid.RowSpan="3"
                                                       Fill="#00000000"
                                                       Stroke="#666666"
                                                       StrokeDashArray=".2 5"
                                                       StrokeDashCap="Round" />
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="VerticalIncrementTemplate"
                                                     TargetType="RepeatButton">
                                        <Grid x:Name="Root"
                                              Background="#00000000">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="25*" />
                                                <ColumnDefinition Width="50*" />
                                                <ColumnDefinition Width="25*" />
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="35*" />
                                                <RowDefinition Height="30*" />
                                                <RowDefinition Height="35*" />
                                            </Grid.RowDefinitions>
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualStateGroup.Transitions>
                                                        <VisualTransition GeneratedDuration="0:0:0.2"
                                                                          To="MouseOver" />
                                                    </VisualStateGroup.Transitions>
                                                    <VisualState x:Name="Normal" />
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="ButtonVisual"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="#FFAAAAAA" />
                                                            </ColorAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ButtonVisual"
                                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                                                      Value="0.6" />
                                                            </DoubleAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                                <VisualStateGroup x:Name="FocusStates">
                                                    <VisualState x:Name="Focused">
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                                           Storyboard.TargetName="FocusVisual"
                                                                                           Storyboard.TargetProperty="Visibility">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <Visibility>Visible</Visibility>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Unfocused">
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                                           Storyboard.TargetName="FocusVisual"
                                                                                           Storyboard.TargetProperty="Visibility">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <Visibility>Collapsed</Visibility>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Path x:Name="ButtonVisual"
                                                  Grid.Column="1"
                                                  Grid.Row="1"
                                                  Stretch="Fill"
                                                  Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                                                  Stroke="#FFAAAAAA">
                                                <Path.Fill>
                                                    <SolidColorBrush Color="#FF5A5A5A"
                                                                     x:Name="ButtonColor" />
                                                </Path.Fill>
                                            </Path>
                                            <Rectangle x:Name="FocusVisual"
                                                       IsHitTestVisible="false"
                                                       Opacity="0"
                                                       Grid.ColumnSpan="3"
                                                       Grid.RowSpan="3"
                                                       Fill="#00000000"
                                                       Stroke="#666666"
                                                       StrokeDashArray=".2 5"
                                                       StrokeDashCap="Round" />
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="VerticalDecrementTemplate"
                                                     TargetType="RepeatButton">
                                        <Grid x:Name="Root"
                                              Background="#00000000">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="25*" />
                                                <ColumnDefinition Width="50*" />
                                                <ColumnDefinition Width="25*" />
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="35*" />
                                                <RowDefinition Height="30*" />
                                                <RowDefinition Height="35*" />
                                            </Grid.RowDefinitions>
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualStateGroup.Transitions>
                                                        <VisualTransition GeneratedDuration="0:0:0.2"
                                                                          To="MouseOver" />
                                                    </VisualStateGroup.Transitions>
                                                    <VisualState x:Name="Normal" />
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="ButtonVisual"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="#FFAAAAAA" />
                                                            </ColorAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ButtonVisual"
                                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                                                      Value="0.6" />
                                                            </DoubleAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                                <VisualStateGroup x:Name="FocusStates">
                                                    <VisualState x:Name="Focused">
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                                           Storyboard.TargetName="FocusVisual"
                                                                                           Storyboard.TargetProperty="Visibility">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <Visibility>Visible</Visibility>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Unfocused">
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                                           Storyboard.TargetName="FocusVisual"
                                                                                           Storyboard.TargetProperty="Visibility">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <Visibility>Collapsed</Visibility>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Path x:Name="ButtonVisual"
                                                  Grid.Column="1"
                                                  Grid.Row="1"
                                                  Stretch="Fill"
                                                  Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "
                                                  Stroke="#FFAAAAAA"
                                                  StrokeThickness="1">
                                                <Path.Fill>
                                                    <SolidColorBrush Color="#FF5A5A5A"
                                                                     x:Name="ButtonColor" />
                                                </Path.Fill>
                                            </Path>
                                            <Rectangle x:Name="FocusVisual"
                                                       IsHitTestVisible="false"
                                                       Opacity="0"
                                                       Grid.ColumnSpan="3"
                                                       Grid.RowSpan="3"
                                                       Fill="#00000000"
                                                       Stroke="#66666666"
                                                       StrokeDashArray=".2 5"
                                                       StrokeDashCap="Round" />
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="VerticalThumbTemplate"
                                                     TargetType="Thumb">
                                        <Grid>
                                            <Grid.Resources>
                                                <SolidColorBrush x:Key="Background"
                                                                 Color="#FF003255" />
                                                <Color x:Key="LinearBevelLightStartColor">#FF5A5A5A</Color>
                                                <Color x:Key="LinearBevelLightEndColor">#FF5A5A5A</Color>
                                                <Color x:Key="LinearBevelDarkStartColor">#FF5A5A5A</Color>
                                                <Color x:Key="LinearBevelDarkEndColor">#FF5A5A5A</Color>
                                                <Color x:Key="HoverLinearBevelLightStartColor">#FFAAAAAA</Color>
                                                <Color x:Key="HoverLinearBevelLightEndColor">#FFAAAAAA</Color>
                                                <Color x:Key="HoverLinearBevelDarkStartColor">#FFAAAAAA</Color>
                                                <Color x:Key="HoverLinearBevelDarkEndColor">#FFAAAAAA</Color>
                                            </Grid.Resources>
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualStateGroup.Transitions>
                                                        <VisualTransition GeneratedDuration="0:0:0.1"
                                                                          To="MouseOver" />
                                                    </VisualStateGroup.Transitions>
                                                    <VisualState x:Name="Normal" />
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="rectangle"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="{StaticResource HoverLinearBevelLightEndColor}" />
                                                            </ColorAnimationUsingKeyFrames>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="rectangle"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="{StaticResource HoverLinearBevelLightEndColor}" />
                                                            </ColorAnimationUsingKeyFrames>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="rectangle"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="{StaticResource HoverLinearBevelDarkStartColor}" />
                                                            </ColorAnimationUsingKeyFrames>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="rectangle"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="{StaticResource HoverLinearBevelDarkEndColor}" />
                                                            </ColorAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ThumbVisual"
                                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                                                      Value="0.6" />
                                                            </DoubleAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Grid x:Name="ThumbVisual">
                                                <Rectangle Margin="2.5,.5,2.5,.5"
                                                           x:Name="Background"
                                                           RadiusX="2.5"
                                                           RadiusY="2.5"
                                                           Fill="{StaticResource Background}" />
                                                <Rectangle Margin="2,0,2,0"
                                                           x:Name="rectangle"
                                                           RadiusX="2.5"
                                                           RadiusY="2.5"
                                                           Stroke="#FF777777"
                                                           StrokeThickness="1">
                                                    <Rectangle.Fill>
                                                        <LinearGradientBrush EndPoint="1,0.5"
                                                                             StartPoint="0,0.5">
                                                            <GradientStop Color="{StaticResource LinearBevelLightStartColor}"
                                                                          Offset="0"
                                                                          x:Name="LinearBevelLightStart" />
                                                            <GradientStop Color="{StaticResource LinearBevelLightEndColor}"
                                                                          Offset="0.35"
                                                                          x:Name="LinearBevelLightEnd" />
                                                            <GradientStop Color="{StaticResource LinearBevelDarkStartColor}"
                                                                          Offset="0.35"
                                                                          x:Name="LinearBevelDarkStart" />
                                                            <GradientStop Color="{StaticResource LinearBevelDarkEndColor}"
                                                                          Offset="1"
                                                                          x:Name="LinearBevelDarkEnd" />
                                                        </LinearGradientBrush>
                                                    </Rectangle.Fill>
                                                </Rectangle>
                                                <Rectangle Margin="3,1,3,1"
                                                           RadiusX="2.5"
                                                           RadiusY="2.5"
                                                           Fill="#00000000" />
                                            </Grid>
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="HorizontalThumbTemplate"
                                                     TargetType="Thumb">
                                        <Grid>
                                            <Grid.Resources>
                                                <SolidColorBrush x:Key="Background"
                                                                 Color="#FF003255" />
                                                <Color x:Key="LinearBevelLightStartColor">#FCFFFFFF</Color>
                                                <Color x:Key="LinearBevelLightEndColor">#F4FFFFFF</Color>
                                                <Color x:Key="LinearBevelDarkStartColor">#E0FFFFFF</Color>
                                                <Color x:Key="LinearBevelDarkEndColor">#B2FFFFFF</Color>
                                                <Color x:Key="HoverLinearBevelLightStartColor">#FCFFFFFF</Color>
                                                <Color x:Key="HoverLinearBevelLightEndColor">#EAFFFFFF</Color>
                                                <Color x:Key="HoverLinearBevelDarkStartColor">#D8FFFFFF</Color>
                                                <Color x:Key="HoverLinearBevelDarkEndColor">#4CFFFFFF</Color>
                                            </Grid.Resources>
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualStateGroup.Transitions>
                                                        <VisualTransition GeneratedDuration="0:0:0.1"
                                                                          To="MouseOver" />
                                                    </VisualStateGroup.Transitions>
                                                    <VisualState x:Name="Normal" />
                                                    <VisualState x:Name="MouseOver">
                                                        <Storyboard>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="rectangle"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="{StaticResource HoverLinearBevelLightEndColor}" />
                                                            </ColorAnimationUsingKeyFrames>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="rectangle"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="{StaticResource HoverLinearBevelLightEndColor}" />
                                                            </ColorAnimationUsingKeyFrames>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="rectangle"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="{StaticResource HoverLinearBevelDarkStartColor}" />
                                                            </ColorAnimationUsingKeyFrames>
                                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="rectangle"
                                                                                          Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                                <SplineColorKeyFrame KeyTime="00:00:00"
                                                                                     Value="{StaticResource HoverLinearBevelDarkEndColor}" />
                                                            </ColorAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ThumbVisual"
                                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                                                      Value="0.6" />
                                                            </DoubleAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Grid x:Name="ThumbVisual">
                                                <Rectangle Margin=".5,2.5,.5,2.5"
                                                           x:Name="Background"
                                                           RadiusX="2.5"
                                                           RadiusY="2.5"
                                                           Fill="{StaticResource Background}" />
                                                <Rectangle Margin="0,2,0,2"
                                                           x:Name="rectangle"
                                                           RadiusX="2.5"
                                                           RadiusY="2.5"
                                                           Stroke="#FF777777"
                                                           StrokeThickness="1">
                                                    <Rectangle.Fill>
                                                        <LinearGradientBrush EndPoint="0.5,1.11"
                                                                             StartPoint="0.5,-0.11">
                                                            <GradientStop Color="{StaticResource LinearBevelLightStartColor}"
                                                                          Offset="0"
                                                                          x:Name="LinearBevelLightStart" />
                                                            <GradientStop Color="{StaticResource LinearBevelLightEndColor}"
                                                                          Offset="0.35"
                                                                          x:Name="LinearBevelLightEnd" />
                                                            <GradientStop Color="{StaticResource LinearBevelDarkStartColor}"
                                                                          Offset="0.35"
                                                                          x:Name="LinearBevelDarkStart" />
                                                            <GradientStop Color="{StaticResource LinearBevelDarkEndColor}"
                                                                          Offset="1"
                                                                          x:Name="LinearBevelDarkEnd" />
                                                        </LinearGradientBrush>
                                                    </Rectangle.Fill>
                                                </Rectangle>
                                                <Rectangle Margin="1,3,1,3"
                                                           RadiusX="2.5"
                                                           RadiusY="2.5"
                                                           Fill="#00000000"
                                                           Stroke="White"
                                                           StrokeThickness="1" />
                                            </Grid>
                                        </Grid>
                                    </ControlTemplate>
                                </Grid.Resources>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal" />
                                        <VisualState x:Name="MouseOver" />
                                        <VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root"
                                                                               Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.5" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Grid x:Name="HorizontalRoot"
                                      Height="9">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <RepeatButton x:Name="HorizontalSmallDecrease"
                                                  Width="16"
                                                  IsTabStop="False"
                                                  Template="{StaticResource HorizontalDecrementTemplate}"
                                                  Grid.Column="0"
                                                  Grid.RowSpan="2"
                                                  Interval="50"
                                                  Background="#FF107BC6" />
                                    <RepeatButton x:Name="HorizontalLargeDecrease"
                                                  Width="0"
                                                  IsTabStop="False"
                                                  Template="{StaticResource RepeatButtonTemplate}"
                                                  Grid.Column="1"
                                                  Grid.RowSpan="2"
                                                  Interval="50" />
                                    <Thumb MinWidth="10"
                                           x:Name="HorizontalThumb"
                                           Width="20"
                                           Template="{StaticResource HorizontalThumbTemplate}"
                                           Grid.Column="2"
                                           Grid.RowSpan="2" />
                                    <RepeatButton x:Name="HorizontalLargeIncrease"
                                                  IsTabStop="False"
                                                  Template="{StaticResource RepeatButtonTemplate}"
                                                  Grid.Column="3"
                                                  Grid.RowSpan="2"
                                                  Interval="50" />
                                    <RepeatButton x:Name="HorizontalSmallIncrease"
                                                  Width="16"
                                                  IsTabStop="False"
                                                  Template="{StaticResource HorizontalIncrementTemplate}"
                                                  Grid.Column="4"
                                                  Grid.RowSpan="2"
                                                  Interval="50" />
                                </Grid>
                                <Grid x:Name="VerticalRoot"
                                      Visibility="Collapsed"
                                      Width="9">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Rectangle Grid.ColumnSpan="2"
                                               Grid.RowSpan="5"
                                               RadiusX="5"
                                               RadiusY="5"
                                               Fill="#FF343434" />
                                    <Rectangle Margin="1,0,0,1"
                                               Grid.ColumnSpan="2"
                                               Grid.RowSpan="5"
                                               StrokeThickness="1"
                                               RadiusX="5"
                                               RadiusY="5"
                                               Fill="#FF343434" />
                                    <RepeatButton Height="16"
                                                  x:Name="VerticalSmallDecrease"
                                                  IsTabStop="False"
                                                  Template="{StaticResource VerticalDecrementTemplate}"
                                                  Grid.ColumnSpan="2"
                                                  Grid.Row="0"
                                                  Interval="50"
                                                  Foreground="#FFAAAAAA"
                                                  Background="#FFAAAAAA" />
                                    <RepeatButton Height="0"
                                                  x:Name="VerticalLargeDecrease"
                                                  IsTabStop="False"
                                                  Template="{StaticResource RepeatButtonTemplate}"
                                                  Grid.ColumnSpan="2"
                                                  Grid.Row="1"
                                                  Interval="50" />
                                    <Thumb Height="20"
                                           MinHeight="10"
                                           x:Name="VerticalThumb"
                                           Template="{StaticResource VerticalThumbTemplate}"
                                           Grid.ColumnSpan="2"
                                           Grid.Row="2" />
                                    <RepeatButton x:Name="VerticalLargeIncrease"
                                                  IsTabStop="False"
                                                  Template="{StaticResource RepeatButtonTemplate}"
                                                  Grid.ColumnSpan="2"
                                                  Grid.Row="3"
                                                  Interval="50" />
                                    <RepeatButton Height="16"
                                                  x:Name="VerticalSmallIncrease"
                                                  IsTabStop="False"
                                                  Template="{StaticResource VerticalIncrementTemplate}"
                                                  Grid.ColumnSpan="2"
                                                  Grid.Row="4"
                                                  Interval="50"
                                                  Foreground="#FFAAAAAA"
                                                  Background="#FF5A5A5A" />
                                </Grid>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="ListBoxScrollViewerStyle"
                   TargetType="ScrollViewer">
                <Setter Property="IsEnabled"
                        Value="true" />
                <Setter Property="Foreground"
                        Value="#FF000000" />
                <Setter Property="BorderBrush"
                        Value="#FFA4A4A4" />
                <Setter Property="BorderThickness"
                        Value="1" />
                <Setter Property="HorizontalContentAlignment"
                        Value="Left" />
                <Setter Property="VerticalContentAlignment"
                        Value="Top" />
                <Setter Property="Cursor"
                        Value="Arrow" />
                <Setter Property="FontSize"
                        Value="11" />
                <Setter Property="VerticalScrollBarVisibility"
                        Value="Hidden" />
                <Setter Property="HorizontalScrollBarVisibility"
                        Value="Visible" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ScrollViewer">
                            <Border BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="1">
                                <Grid Background="{TemplateBinding Background}">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Rectangle Grid.Column="1"
                                               Grid.Row="1"
                                               Fill="GhostWhite" />
                                    <ScrollContentPresenter />
                                    <ScrollBar Cursor="Arrow"
                                               x:Name="VerticalScrollBar"
                                               Width="9"
                                               Grid.Column="1"
                                               HorizontalAlignment="Right"
                                               Grid.Row="0"
                                               Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                               Orientation="Vertical"
                                               ViewportSize="{TemplateBinding ViewportHeight}"
                                               Maximum="{TemplateBinding ScrollableHeight}"
                                               Minimum="0"
                                               Value="{TemplateBinding VerticalOffset}"
                                               Style="{StaticResource ScrollBarStyle}" />
                                    <ScrollBar Cursor="Arrow"
                                               Height="9"
                                               x:Name="HorizontalScrollBar"
                                               Grid.Column="0"
                                               Grid.Row="1"
                                               Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                               Orientation="Horizontal"
                                               ViewportSize="{TemplateBinding ViewportWidth}"
                                               Maximum="{TemplateBinding ScrollableWidth}"
                                               Minimum="0"
                                               Value="{TemplateBinding HorizontalOffset}"
                                               Style="{StaticResource ScrollBarStyle}" />
                                </Grid>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <DataTemplate x:Key="MapEventDataTemplate">
                <Grid>
                    <Image Source="{Binding Image}"
                           Width="60"
                           Height="60" />
                </Grid>
            </DataTemplate>
            <Style x:Key="ListBoxItemStyle1"
                   TargetType="ListBoxItem">
                <Setter Property="Padding"
                        Value="3" />
                <Setter Property="HorizontalContentAlignment"
                        Value="Left" />
                <Setter Property="VerticalContentAlignment"
                        Value="Top" />
                <Setter Property="Background"
                        Value="Transparent" />
                <Setter Property="BorderThickness"
                        Value="1" />
                <Setter Property="TabNavigation"
                        Value="Local" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBoxItem">
                            <Grid x:Name="grid"
                                  Background="{TemplateBinding Background}">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualStateGroup.Transitions>
                                            <VisualTransition GeneratedDuration="0:0:0.3">
                                                <VisualTransition.GeneratedEasingFunction>
                                                    <CubicEase EasingMode="EaseOut" />
                                                </VisualTransition.GeneratedEasingFunction>
                                            </VisualTransition>
                                        </VisualStateGroup.Transitions>
                                        <VisualState x:Name="Normal">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                               Storyboard.TargetName="grid">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                                <DoubleAnimation Duration="0"
                                                                 To="0"
                                                                 Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                 Storyboard.TargetName="grid"
                                                                 d:IsOptimized="True" />
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0"
                                                                 To=".35"
                                                                 Storyboard.TargetProperty="Opacity"
                                                                 Storyboard.TargetName="fillColor" />
                                                <DoubleAnimation Duration="0"
                                                                 To="0.8"
                                                                 Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                 Storyboard.TargetName="grid"
                                                                 d:IsOptimized="True" />
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0"
                                                                 To=".55"
                                                                 Storyboard.TargetProperty="Opacity"
                                                                 Storyboard.TargetName="contentPresenter" />
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="SelectionStates">
                                        <VisualState x:Name="Unselected" />
                                        <VisualState x:Name="Selected">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0"
                                                                 To=".75"
                                                                 Storyboard.TargetProperty="Opacity"
                                                                 Storyboard.TargetName="fillColor2" />
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="FocusStates">
                                        <VisualState x:Name="Focused">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Duration="0"
                                                                               Storyboard.TargetProperty="Visibility"
                                                                               Storyboard.TargetName="FocusVisualElement">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Unfocused" />
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Rectangle x:Name="fillColor"
                                           IsHitTestVisible="False"
                                           Opacity="0"
                                           RadiusY="1"
                                           RadiusX="1" />
                                <Rectangle x:Name="fillColor2"
                                           IsHitTestVisible="False"
                                           Opacity="0"
                                           RadiusY="1"
                                           RadiusX="1" />
                                <ContentPresenter x:Name="contentPresenter"
                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                  Content="{TemplateBinding Content}"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  Margin="{TemplateBinding Padding}" />
                                <Rectangle x:Name="FocusVisualElement"
                                           RadiusY="1"
                                           RadiusX="1"
                                           StrokeThickness="1"
                                           Visibility="Collapsed" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

        </ResourceDictionary>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot">
    	<VisualStateManager.CustomVisualStateManager>
    		<ei:ExtendedVisualStateManager/>
    	</VisualStateManager.CustomVisualStateManager>
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="VisualStateGroup" ei:ExtendedVisualStateManager.UseFluidLayout="True">
    			<VisualStateGroup.Transitions>
    				<VisualTransition GeneratedDuration="0:0:0.5">
    					<VisualTransition.GeneratedEasingFunction>
    						<QuadraticEase EasingMode="EaseOut"/>
    					</VisualTransition.GeneratedEasingFunction>
    				</VisualTransition>
    			</VisualStateGroup.Transitions>
    			<VisualState x:Name="NormalState"/>
    			<VisualState x:Name="InfoState">
    				<Storyboard>
    					<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="InfoGrid" d:IsOptimized="True"/>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="InfoGrid">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<Visibility>Visible</Visibility>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="InfoGrid">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<System:Double>380</System:Double>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
        <Grid>

            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Path x:Name="BackgroundRectangle"
                  Data="M187.2383,141.7393C187.2383,141.7393,176.3913,144.7943,172.5713,149.0723C164.2383,158.4063,166.5713,209.7393,165.2383,221.7393C163.9053,233.7393,163.9053,364.4073,165.2383,397.0733C166.5713,429.7393,165.2383,441.7393,167.9053,452.4053C170.5713,463.0733,178.5713,462.4053,187.2383,465.7393C195.9053,469.0733,317.9053,475.0733,335.2383,475.0733C352.5713,475.0733,497.2383,476.4073,523.9053,475.0733C550.5723,473.7393,617.2393,476.4053,630.5723,469.7393C643.9053,463.0733,651.2383,452.4053,651.2383,435.7393C651.2383,419.0733,652.5713,301.0723,651.2383,249.0723C649.9053,197.0723,651.8313,159.3863,645.9053,150.4063C641.9333,144.3863,629.2383,143.7393,617.9053,141.7393C606.5723,139.7393,419.9053,137.7393,381.2383,138.4063C342.5713,139.0723,187.2383,141.7393,187.2383,141.7393z"
                  Stretch="Fill">
                <Path.Effect>
                    <DropShadowEffect Opacity="0.5" />
                </Path.Effect>
                <Path.Fill>
                    <RadialGradientBrush RadiusX="0.8">
                        <GradientStop Color="#FFD1E778" />
                        <GradientStop Color="#FF4A6305"
                                      Offset="1" />
                    </RadialGradientBrush>
                </Path.Fill>
            </Path>

            <Grid x:Name="eventsView">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>

                <Image Grid.RowSpan="2"
                       Width="141"
                       HorizontalAlignment="Left"
                       Margin="-55,-48,0,-27"
                       Source="images/questHeader.png" />

                <TextBlock Text="Quests"
                           Grid.Row="0"
                           Grid.ColumnSpan="2"
                           VerticalAlignment="Center"
                           HorizontalAlignment="Center"
                           Foreground="Yellow"
                           FontWeight="Bold"
                           FontSize="30"
                           FontFamily="Segoe UI">
                	<TextBlock.Effect>
                		<BlurEffect />
                	</TextBlock.Effect>
                </TextBlock>
                <TextBlock Text="Quests"
                           Grid.ColumnSpan="2"
                           Grid.Row="0"
                           VerticalAlignment="Center"
                           HorizontalAlignment="Center"
                           Foreground="White"
                           FontSize="29"
                           FontFamily="Segoe UI"
                           Margin="0,1,0,0"
                           Width="93.0033340454102" />

                <Button x:Name="CloseButton"
                        Grid.ColumnSpan="2"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Top"
                        Margin="10"
                        Style="{StaticResource CloseButtonStyle}"
                        Command="{Binding CloseEventsCommand}" />

                <Image Grid.Row="2"
                       Margin="20"
                       Grid.RowSpan="4"
                       Source="{Binding SelectedEvent.Image}" />
					   
					   <StackPanel Grid.Row="2"
                           Grid.Column="1">
                <TextBlock Text="{Binding SelectedEvent.Title}"
                           TextWrapping="Wrap"	
						   Margin="10"					   
                           HorizontalAlignment="Center"                           
                           VerticalAlignment="Center"                           
                           Foreground="White"
                           FontFamily="Segoa UI"
                           FontSize="21.333" />

                <TextBlock Text="{Binding SelectedEvent.Description}"                           
                           TextWrapping="Wrap"
                           Foreground="White"
                           FontSize="12"
                           FontFamily="Segoa UI"
                           HorizontalAlignment="Center"
                           VerticalAlignment="Top" 
						   TextTrimming="WordEllipsis"
                            />
					</StackPanel>
                <TextBlock Text="{Binding Greeting}"
                           FontSize="12"
                           Grid.Row="3"
                           TextWrapping="Wrap"
                           Foreground="White"
                           FontFamily="Segoa UI"
                           Grid.Column="1"
                           HorizontalAlignment="Right"
                           Margin="0,10,10,10" d:LayoutOverrides="Height, VerticalMargin" />

               <!-- <StackPanel Grid.Row="4"
                            Grid.Column="1">
                    <TextBlock FontSize="12"
                               Text="Required Badges:"
                               Foreground="White"
                               FontFamily="Segoa UI" />
                    <ListBox BorderThickness="0"
                             ItemsSource="{Binding SelectedEvent.RequiredBadges}"
                             ItemTemplate="{StaticResource BadgesDataTemplate}"
                             ItemsPanel="{StaticResource EventsItemsPanelTemplate}"
                             ItemContainerStyle="{StaticResource EventsListBoxItemStyle}"
                             Background="Transparent"
                             ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                             ScrollViewer.VerticalScrollBarVisibility="Hidden" />
                </StackPanel>-->

                <Button x:Name="actionButton" Grid.Row="4"
                        Content="{Binding StartGreeting}"
                        Command="{Binding StartEventCommand}"
                        Grid.Column="1"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Bottom"
                        Style="{StaticResource GwButtonStyle}" />
						
						<Button x:Name="howToButton" Grid.Row="4"
                        Content=" How does it work "
                        Grid.Column="0"
						Margin="10"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Bottom"
                        Style="{StaticResource GwLiteButtonStyle}" >
							<i:Interaction.Triggers>
								<i:EventTrigger EventName="Click">
									<ei:GoToStateAction StateName="InfoState"/>
								</i:EventTrigger>
							</i:Interaction.Triggers>
						</Button>

                <ScrollViewer Grid.ColumnSpan="3"
                              BorderThickness="0"
                              Style="{StaticResource ListBoxScrollViewerStyle}"
                              Margin="3,10,3,10"
                              Grid.Row="6">
                    <ListBox BorderThickness="0"
                             ItemsSource="{Binding EventsList}"
                             SelectedItem="{Binding SelectedEvent, Mode=TwoWay}"
                             ItemTemplate="{StaticResource EventsDataTemplate}"
                             ItemsPanel="{StaticResource EventsItemsPanelTemplate}"
                             ItemContainerStyle="{StaticResource EventsListBoxItemStyle}"
                             Background="Transparent"
                             ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                             ScrollViewer.VerticalScrollBarVisibility="Hidden" />

                </ScrollViewer>

                <Line  Grid.Row="6"
                       Margin="20,5"
                       HorizontalAlignment="Stretch"
                       VerticalAlignment="Top"
                       X2="100"
                       Grid.ColumnSpan="3"
                       Stroke="#FF27A172"
                       Stretch="Fill" />
					   
            </Grid>

		

            <!--<ec:PathListBox Height="20.25"
                            Grid.Row="1"
                            VerticalAlignment="Bottom"
                            HorizontalAlignment="Left"
                            Width="17.049"
                            RenderTransformOrigin="-0.062,2.494">
                <ec:PathListBox.LayoutPaths>
                    <ec:LayoutPath SourceElement="{Binding ElementName=path}"
                                   Distribution="Even" />
                </ec:PathListBox.LayoutPaths>
                
                <Image Height="37"
                       Width="35"
                       Source="../images/goals/1.jpg" />
                <Image Height="37"
                       Width="35"
                       Source="../images/goals/2.jpg" />
                <Image Height="37"
                       Width="35"
                       Source="../images/goals/3.jpg" />
                <Image Height="37"
                       Width="35"
                       Source="../images/goals/4.jpg" />
                <Image Height="37"
                       Width="35"
                       Source="../images/goals/5.jpg" />
                <Image Height="37"
                       Width="35"
                       Source="../images/goals/6.jpg" />
                <Image Height="37"
                       Width="35"
                       Source="../images/goals/7.jpg" />
                <Image Height="37"
                       Width="35"
                       Source="../images/goals/8.jpg" />
            </ec:PathListBox>
            <Path x:Name="path"
                  Grid.Row="1"
                  Data="M92,398 L598.5,399"
                  Height="1"
                  Margin="60,30"
                  Stretch="Fill"
                  StrokeThickness="5"
                  UseLayoutRounding="False"
                  VerticalAlignment="Bottom" />-->
				  
				  <Grid x:Name="InfoGrid" HorizontalAlignment="Center" Margin="60,60,60,30" 
				  VerticalAlignment="Bottom" Width="550" Height="0" Opacity="0" Visibility="Collapsed">
                    
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    
                    <Path Grid.RowSpan="3" Data="M187.2383,141.7393C187.2383,141.7393,176.3913,144.7943,172.5713,149.0723C164.2383,158.4063,166.5713,209.7393,165.2383,221.7393C163.9053,233.7393,163.9053,364.4073,165.2383,397.0733C166.5713,429.7393,165.2383,441.7393,167.9053,452.4053C170.5713,463.0733,178.5713,462.4053,187.2383,465.7393C195.9053,469.0733,317.9053,475.0733,335.2383,475.0733C352.5713,475.0733,497.2383,476.4073,523.9053,475.0733C550.5723,473.7393,617.2393,476.4053,630.5723,469.7393C643.9053,463.0733,651.2383,452.4053,651.2383,435.7393C651.2383,419.0733,652.5713,301.0723,651.2383,249.0723C649.9053,197.0723,651.8313,159.3863,645.9053,150.4063C641.9333,144.3863,629.2383,143.7393,617.9053,141.7393C606.5723,139.7393,419.9053,137.7393,381.2383,138.4063C342.5713,139.0723,187.2383,141.7393,187.2383,141.7393z"
                          Stretch="Fill">
                        <Path.Effect>
                            <DropShadowEffect />
                        </Path.Effect>
                        <Path.Fill>
                            <RadialGradientBrush RadiusX="0.8">
                                <GradientStop Color="#FFD1E778" />
                                <GradientStop Color="#FF4A6305"
                                              Offset="1" />
                            </RadialGradientBrush>
                        </Path.Fill>
                    </Path>

                    <TextBlock Grid.Row="0"  Margin="30,5" FontFamily="Segoa UI"
					FontSize="12" Foreground="White" TextAlignment="Center"
                               TextWrapping="Wrap"  
                               HorizontalAlignment="Center" VerticalAlignment="Center">
                    	
	<Run Text="Taking quests is easy. When you earn experience you can initiate and take part in your friends quests!" />
	
	<Run Text="Some of the quests you do on your own and the others can support you good cause!" /> 		
	<Run Text="The other quests you do together with your frinds. You have to be connected to each other and to play on the same map." />
	<LineBreak />
	<LineBreak />
	<Run Text=" There are two main type of quests: ACTIONS and CAUSES" />
	<LineBreak />
	<Run Text=" In order to take the quest you either have to Join a Cause ot to Take some actions! To do that you need a particular set of badges. If you have connected with the other players on the map, they can Join your Quest and help you with the set of badges they have!" />
	<LineBreak />
	<LineBreak />
	<Run Text=" So, work together! There's no time! Be the first to take all the quests!" />
                    	</TextBlock>
                    
                    <Button Grid.Row="2" 
                            x:Name="CloseMeButton"
                            VerticalAlignment="Center"
                            Content=" OK "
                            Style="{StaticResource GwButtonStyle}"
                            Margin="10" HorizontalAlignment="Center" >
                    	<i:Interaction.Triggers>
                    		<i:EventTrigger EventName="Click">
                    			<ei:GoToStateAction StateName="NormalState"/>
                    		</i:EventTrigger>
                    	</i:Interaction.Triggers>
                    	
                    </Button>
					<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,20,0">
                    <Image Margin="20" Source="unleashed-logo.jpg" Stretch="Fill" HorizontalAlignment="Center" Height="42" VerticalAlignment="Center" Width="174"/>
                    <TextBlock FontFamily="Segoa UI" 
                    	FontSize="10" Foreground="White" TextWrapping="Wrap" Width="315" HorizontalAlignment="Left" VerticalAlignment="Bottom"><Run Text="Unleashed is Australia's national youth animal rights group. They combine forces with bands, artists and people like you to get the word out about how everyone can help animals and the environment. They have provided us with the Causes Quests Stickers!"/></TextBlock>
					</StackPanel>
                </Grid>
        </Grid>


    </Grid>
</UserControl>
